home *** CD-ROM | disk | FTP | other *** search
- /*
- File: AtoBMailGateway.h
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __ATOBMAILGATEWAY__
- #define __ATOBMAILGATEWAY__
-
- #ifndef __BLJSTANDARDINCLUDES__
- #include "BLJStandardIncludes.h"
- #endif
-
- #ifndef __MAILGATEWAY__
- #include "MailGateway.h"
- #endif
-
- #ifndef __HFSTUPLEDATABASE__
- #include "HFSTupleDatabase.h"
- #endif
-
- class THalfGateway;
-
- /***********************************|****************************************/
-
- class TAtoBMailGateway : public TMailGateway
- {
- public:
- TAtoBMailGateway ( THalfGateway *a, THalfGateway *b, short vRefNum, long parID );
- virtual ~TAtoBMailGateway();
-
- // This sets the gateway up and gets it ready to start running.
- virtual Boolean Setup ( short vRefNum, long dirID, const char* serverName ); // this will load the named configuration
-
- // This 'starts' the gateway off and running.
- virtual Boolean Run(void);
-
- // This prepares the gateway to shut down. The gateway won't be fully shut down until the
- // ReadyToShutDown() returns true.
- virtual Boolean PrepareToShutDown(long inHowManySeconds);
- virtual Boolean ReadyToShutDown(void);
- virtual Boolean CancelGatewayShutdown (void);
- virtual Boolean ShutDown(void);
-
- // These deal with sending a letter from the local system to the remote system.
- virtual Boolean ReceiveLetter (TLetter *letter, THalfGateway *originatorHalfGateway);
- virtual Boolean RereceiveLetter(TLetter* letter, THalfGateway* originatorHalfGateway);
-
- //
- // CONFIGURATION / SETUP METHODS
- // =============================
- //
- virtual Boolean GetConfigItem(const ATupleKey& key, ADataItem& );
- virtual Boolean SetConfigItem(const ATupleKey& key, const ADataItem& );
- virtual Boolean DeleteConfigItem(const ATupleKey& key);
- virtual Boolean GetNthConfigKey(unsigned long index, ATupleKey& key);
-
- //
- // STATUS REPORTING / ERROR REPORTING OPTIONS
- // ==========================================
- //
- virtual Boolean GetStatusItem(const ATupleKey& key, ADataItem& );
- virtual Boolean SetStatusItem(const ATupleKey& key, const ADataItem& );
-
- protected:
- THFSTupleDatabase fConfigurationDB;
- THFSTupleDatabase fStatusDB;
- THalfGateway* fAHalfGateway;
- THalfGateway* fBHalfGateway;
- };
-
- /***********************************|****************************************/
- /***********************************|****************************************/
-
- #pragma segment TAtoBMailGateway
-
- inline Boolean
- TAtoBMailGateway::GetConfigItem(const ATupleKey& key, ADataItem& data )
- {
- return fConfigurationDB.GetTupleData ( key, data );
- }
-
- /***********************************|****************************************/
-
- inline Boolean
- TAtoBMailGateway::SetConfigItem(const ATupleKey& key, const ADataItem& data )
- {
- return fConfigurationDB.SetTuple ( key, data );
- }
-
- /***********************************|****************************************/
-
- inline Boolean
- TAtoBMailGateway::DeleteConfigItem(const ATupleKey& key)
- {
- return fConfigurationDB.DeleteTuple( key );
- }
-
- /***********************************|****************************************/
-
- inline Boolean
- TAtoBMailGateway::GetNthConfigKey(unsigned long index, ATupleKey& key)
- {
- return fConfigurationDB.GetTupleKey ( index, key );
- }
-
- /***********************************|****************************************/
-
- #endif // __ATOBMAILGATEWAY__
-